//
//  LDBaseCells.swift
//  DingDongZP
//
//  Created by 三秒文化 on 16/4/26.
//  Copyright © 2016年 iyhjiang.com. All rights reserved.
//

import UIKit
<<<<<<< HEAD

class LDBaseCells: UITableViewCell {
=======
enum LDBaseCellType {
    //上下左右有无margin
    case TopGamp
    case BottomGamp
    case LeftAndRithtGamp
    case NoGamp
    case TopAndBottomGamp
    case AllGamp
}

class LDBaseCells: UITableViewCell {
    
    var topMargin = LDMargin_V*3
    var leftMargin = LDMargin_H*4
    var rightMargin = LDMargin_H*4
    
    
    private var type:LDBaseCellType?
    lazy var gampMarginView = { return UIView() }()
>>>>>>> dingdong2.1.0

    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        selectionStyle = .None
    }
    
<<<<<<< HEAD
=======
    init(type:LDBaseCellType,margin:CGFloat,style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        
        initUI(margin,type: type)

    }
    
    func initUI(margin:CGFloat,type:LDBaseCellType) {
        
        gampMarginView.backgroundColor = LDGolbalColor.White
        contentView.addSubview(gampMarginView)
        self.type = type
        
        switch type {
        case .TopAndBottomGamp:
            
            selectionStyle = UITableViewCellSelectionStyle.None
            gampMarginView.snp_makeConstraints { (make) in
                
                make.left.right.equalTo(0)
                make.top.equalTo(margin)
                make.bottom.equalTo(-margin)
                
            }
        case .TopGamp:
            
            selectionStyle = UITableViewCellSelectionStyle.None
            gampMarginView.snp_makeConstraints { (make) in
                
                make.top.equalTo(margin)
                make.left.right.equalTo(0)
                make.bottom.equalTo(0)
                
            }
            
        default:
            break
        }
        
    }
    
>>>>>>> dingdong2.1.0
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

<<<<<<< HEAD
    override func setSelected(selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
        
    }
=======
//    override func setSelected(selected: Bool, animated: Bool) {
//        super.setSelected(selected, animated: animated)
//    
//    }
>>>>>>> dingdong2.1.0

}
